Optional Seki.f

cr .( Loading SEKI ... )

Only Forth Definitions

0 value screen-w
0 value screen-h
0 value fullscreen?
create caption 256 allot
0 value display?
0 value seki-window
HWND value ide-window
0 value desktop-w
0 value desktop-h

Requires Seki\Seki-SF   \ SwiftForth
Requires Seki\Seki-Sdl
Requires Seki\Input

Requires OpenGL\GL-Extensions
Requires Opengl\Glext-Functions

\ Drawing utilities

Requires FixedPoint
Requires GL-Tools

[undefined] 2dmode? [if] 0 value 2dmode? [then]

: aspect-ratio   screen-w S>. screen-h S>. ./ ;

: 3DMODE     pm-identity   glFrustum( aspect-ratio 10 / dup negate .>f swap .>f -0.1e 0.1e 0.1e 100e )  false to 2dmode?   mv-identity ;
\ : ORTHOMODE  pm-identity   glOrtho( aspect-ratio dup negate s>f swap s>f -1.0e 1.0e 0.1e 100e )  false to 2dmode?   mv-identity ;
\ : 2DMODE     pm-identity   glOrtho( 0e screen-w s>f screen-h s>f -0.45e f+ -0.45e  1024e -1024e )   true to 2dmode? mv-identity ;
: 2DMODE     pm-identity   glOrtho( -0.45e screen-w s>f -0.45e f+  screen-h s>f -0.45e f+ -0.45e  1024e -1024e )   true to 2dmode? mv-identity ;

\ Display utilities

: fullscreen  true set-display ;
: window  false set-display ;
: display   fullscreen? set-display ;


\ :onload   init-video-driver seki-sdl-recreate-surfaces ;

: >seki ( -- )
   seki-window set-foreground-window ;

